﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心</title>
    <style>
        body {
            background: #F0F4E9;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            margin: 0;
            padding: 20px;
        }
        a {
            text-decoration: none;
            color: inherit;
        }
        .profile-card {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            max-width: 800px;
            margin: 0 auto;
        }
        .avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: #E0E7FF;
            margin: 0 auto 20px;
            position: relative;
        }
        .avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }
        .username {
            font-size: 28px;
            text-align: center;
            color: #2C3E50;
            margin-bottom: 15px;
        }
        .bio {
            text-align: center;
            color: #666;
            line-height: 1.6;
            margin-bottom: 30px;
            padding: 0 20px;
        }
        .section {
            margin-bottom: 30px;
        }
        .section-title {
            font-size: 20px;
            color: #34495E;
            border-bottom: 2px solid #A3D0C3;
            padding-bottom: 8px;
            margin-bottom: 15px;
        }
        .work-item {
            display: flex;
            gap: 20px;
            margin-bottom: 15px;
        }
        .work-thumbnail {
            width: 120px;
            height: 80px;
            background: #E5E9F2;
            border-radius: 8px;
            flex-shrink: 0;
        }
        .work-content {
            flex-grow: 1;
        }
        .work-title {
            font-size: 18px;
            color: #2C3E50;
            margin: 0 0 8px;
        }
        .work-desc {
            color: #7F8C8D;
            line-height: 1.4;
        }
        .blog-item {
            background: #F8F9FA;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 10px;
        }
        .blog-title {
            color: #3498DB;
            font-size: 16px;
            margin: 0 0 5px;
        }
        .blog-date {
            color: #95A5A6;
            font-size: 14px;
        }
        @media (max-width: 768px) {
            .work-item { flex-direction: column; }
            .work-thumbnail { width: 100%; height: 160px; }
        }
    </style>
</head>
<body>
    <div class="profile-card">
        <!-- 用户基本信息 -->
        <div class="avatar">
            <img src="/avaphoto={{ id }}" alt="">
        </div>
        <div class="username">{{ username }}#{{ id }}{{ email|safe }} Lv.{{ Grade }}</div>
        <div class="bio">
             {{ grby }}
        </div>
        
        <div class="section">
            <div class="section-title">关于我</div>
            <div class="work-item">
                <div class="work-content">
                    <p>金币：{{ money }}  {{ qiandao | safe }}</p>
                    <div class="work-desc">
                    {{ jianjie | safe }}
                </div>
            </div>
        </div>
        
        <!-- 用户作品 -->
        <div class="section">
            <div class="section-title">作品集</div>
            <div class="work-item">
                <div class="work-desc">
                    {% for item in zhuopinsc1 %}
                         <a href="/scratch/{{ item.id }}">{{ item.title }}</a><br>
                    {% else %}
                        <p>该用户没有作品</p>
                    {% endfor %}
                </div>
            </div>
        </div>
        <div class="section">
            <div class="section-title">收藏作品</div>
            <div class="work-item">
                <div class="work-desc">
                    {% for item in zhuopinsc2%}
                         <a href="/scratch/{{ item.id }}">{{ item.title }}</a><br>
                    {% else %}
                        <p>主人qwq，这个用户坏坏，不让我获取收藏数据</p>
                    {% endfor %}
                </div>
            </div>
        </div>
    </div>
</body>
</html>
